<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title>永修高标准农田-个人中心</title>
		<link rel="import" href="../header.html" id="page1">
		<style>
			html,body {
				background-color: #efeff4;
			}
			.title{
				margin: 20px 15px 10px;
				color: #6d6d72;
				font-size: 15px;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<h1 class="mui-title">个人中心</h1>
			<a class="mui-icon mui-icon-info mui-pull-right"></a>
		</header>
		<div id="app" class="mui-content" v-cloak>
			<div class="title">
				
			</div>
			<ul class="mui-table-view">
				<li class="mui-table-view-cell">
					<a class="">
						<span class="mui-icon-extra mui-icon-extra-people"></span>
						用户名
						<span class="mui-pull-right">{{user.username}}</span>
					</a>
				</li>
				<li class="mui-table-view-cell">
					<a class="">
						<span class="mui-icon mui-icon-chatbubble"></span>
						姓名
						<span class="mui-pull-right">{{user.name}}</span>
					</a>
				</li>
				<li class="mui-table-view-cell">
					<a class="">
						<span class="mui-icon-extra mui-icon-extra-peoples"></span>
						部门
						<span class="mui-pull-right">{{user.deptName}}</span>
					</a>
				</li>
				<li class="mui-table-view-cell">
					<a class="">
						<span class="mui-icon mui-icon-phone"></span>
						手机号
						<span class="mui-pull-right">{{user.mobile}}</span>
					</a>
				</li><li class="mui-table-view-cell">
					<a class="">
						<span class="mui-icon mui-icon-email"></span>
						邮箱
						<span class="mui-pull-right">{{user.email}}</span>
					</a>
				</li>
			</ul>
			<ul class="mui-table-view" style="margin-top: 25px;">
				<li class="mui-table-view-cell">
					<a id="about" class="mui-navigate-right">
						<span class="mui-icon mui-icon-locked"></span>
						修改密码
					</a>
				</li>
			</ul>
			<ul class="mui-table-view" style="margin-top: 25px;">
				<li class="mui-table-view-cell">
					<a style="text-align: center;color: #FF3B30;" @click="logoutHandle">
						退出登录
					</a>
				</li>
			</ul>
		</div>
		</style>
	</body>
	<script>
		mui.init({
			swipeBack:true, //启用右滑关闭功能
			statusBarBackground: '#f7f7f7'
		});
		
		var vm = new Vue({
			el:"#app",
			data:{
				user:{}
			},
			methods:{
				logoutHandle(){
				  mui.confirm('确认退出登录？','提示',["确定","取消"],function(e){
					if(e.index==0){
						mui.post(baseUrl+"/sys/logout",{},function(r){
							if (r && r.code === 0) {
								clearLoginInfo();
								plus.runtime.restart();
							}else{
								mui.toast(r.msg,{ duration:'long', type:'div' }) 
							}
						});
					}
				  });
					
				}
			},
			created() {
			    this.user = JSON.parse(localStorage.getItem("user"));
			}
		})
		
		
		
	</script>
</html>